--[[
	hades框架入口配置
]]

local RouteHandler = require("mvc.route_handler")
local Dispatcher = require("mvc.dispatcher");
local rewrite_handler = require("mvc.urlrewrite_handler")

--加载URI路由配置
local route_handler = RouteHandler:new("config.router");

--获取当前URI
local uri = ngx.var.uri;

--处理urlwrite
local rewrite_target = rewrite_handler.get_target(uri);
if rewrite_target ~= nil then
	uri = rewrite_target;
end

--根据URI获取对应的路由处理器
local router = route_handler:get_router(uri);

--实例化dispathcer并调用
local dispatcher = Dispatcher:new(router, uri);
dispatcher:do_dispatch();



